package com.mf.service.impl.basic;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import com.mf.entity.dto.basic.DtoSet;
import com.mf.entity.req.basic.search.SearchReqSet;
import com.mf.mapper.basic.MapperSet;
import com.mf.service.basic.ServiceSet;


@Service
public class ImplServiceSet extends ServiceImpl<MapperSet, DtoSet> implements ServiceSet {

    /**
     * 参数查询条件
     */
    @Override
    public LambdaQueryWrapper<DtoSet> fillParams(SearchReqSet params) {
        LambdaQueryWrapper<DtoSet> wrapper = loadQw();
        if (StringUtils.isNotBlank(params.getKey())) {
            wrapper.like(DtoSet::getSetMark, params.getKey())
                    .or()
                    .like(DtoSet::getSetKey, params.getKey())
                    .or()
                    .like(DtoSet::getSetValue, params.getKey());
        }
        return wrapper;
    }

}